<script>
import GmTable from "@/view/components/gmTable.vue";

export default {
  components: {
    GmTable: GmTable
  },
  data() {
    return {
      tableConfig: {
        control: 't-vehicle-information',
        mainKey: 'vehicleLicenseLate'//数据主键，用于删除该条数据
      },
      tableColumns: [{
        name: 'carBrand',
        label: '汽车品牌',
        id: 'carBrand',
        search: true,
        required: false,
        searchType: 'advise-input',
      }, {
        name: 'vehicleLicenseLate',
        label: '车牌号牌',
        id: 'vehicleLicenseLate',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'routeEns',
        label: '车辆负责路线',
        id: 'routeEns',
        search: false,
        required: '/t-route/findPage',
        searchType: 'more-select',
        props:{
          label:'routeName',
          value:'routeCode',
        },
        getValue: function (obj) {
          let str = '';
          obj.forEach(x => {
            str += `${x.routeName},`
          })
          return str
        }
      }, {
        name: 'companyCode',
        label: '承运企业',
        id: 'companyCode',
        search: false,
        required: '/t-transportation-company-information/findPage',
        searchType: 'select',
        hide:true,
        props:{
          label:'companyName',
          value:'companyCode',
        }
      }, {
        name: 'seatingCapacity',
        label: '座位数',
        id: 'seatingCapacity',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'companyName',
        label: '所属企业',
        id: 'companyName',
        addHide:true,
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'drives',
        label: '司机',
        id: 'drives',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'drivingLicensePath',
        label: '行驶证照片',
        id: 'drivingLicensePath',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'latestAnnualAuditDate',
        label: '最后年审时间',
        id: 'latestAnnualAuditDate',
        search: false,
        required: false,
        searchType: 'date',
      },{
          name: 'createDate',
          label: '创建时间',
          id: 'createDate',
          search: false,
          searchType: 'state',
          addHide: true,
      },{
          name: 'createUserName',
          label: '创建人',
          id: 'createUserName',
          search: false,
          searchType: 'state',
          addHide: true,
      },{
          name: 'state',
          label: '状态',
          id: 'state',
          search: false,
          required: '/common/getItem/state',
          searchType: 'state',
      }],
    }
  },
}
</script>

<template>
  <div class="page-car">
    <gm-table :table-columns="tableColumns" :table-config="tableConfig"></gm-table>
  </div>
</template>

<style scoped>

</style>
